package cn.news.control;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.news.biz.PressBiz;

public class UserSearchServlet extends HttpServlet {

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		
		 response.setContentType("text/html;Charset=utf-8");
		 String keyword=request.getParameter("keyword");
		 PrintWriter out=response.getWriter();
		 
		 PressBiz pBiz=new PressBiz();
		 String titles=pBiz.searchkeyword(keyword);
		 if(titles!=null&&titles.length()>0){
			 out.print(titles);
		 }else{
			 out.print("");
		 }
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}
}
